package com.nbsaas.boot.cms.data.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.nbsaas.boot.code.annotation.data.Dict;
import com.nbsaas.boot.code.annotation.data.DictItem;
import lombok.Data;
import org.hibernate.annotations.Comment;

import javax.persistence.*;

@TableName("bs_article")
@org.hibernate.annotations.Table(appliesTo = "bs_article", comment = "文章")
@Entity
@Table(name = "bs_article")
@Data
public class Article {

    @TableId(value = "id", type = IdType.AUTO)
    @Id()
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Comment("主键id")
    private Long id;

    @Comment("文章标题")
    private String title;

    @Dict(items =
            {@DictItem(value = 1, label = "正常"),
             @DictItem(value = 2, label = "删除")
            }
    )
    private Integer state;
}
